#ifndef __SYSTIME_H
#define __SYSTIME_H

#include "my_define.h"

typedef struct
{
    uint32_t sec;
    uint16_t msec;
} timestamp_t;

void systime_init(void);
void systime_enter_sleep(void);

void get_current_systime(timestamp_t *time);
void relative_time_add_ms(timestamp_t *time, uint16_t ms);
void relative_time_add_sec(timestamp_t *time, uint32_t s);
uint8 is_relative_time_timeout(const timestamp_t *time);
void relative_time_delay_sec(uint32_t s);
void relative_time_delay_msec(uint16_t ms);

#endif
